package com.duomn.mybatis.plugins.config;

import java.util.ArrayList;
import java.util.List;

public class ShardingTable {
	
	private String name;
	
	private String exp;
	
	private List<Rule> rules;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getExp() {
		return exp;
	}

	public void setExp(String exp) {
		this.exp = exp;
	}

	public List<Rule> getRules() {
		return rules;
	}

	public void setRules(List<Rule> rules) {
		this.rules = rules;
	}
	
	public void addRule(Rule rule) {
		if (rules == null) {
			rules = new ArrayList<Rule>();
		}
		rules.add(rule);
	}
	
	public String toString() {
		return "[name:" + name + ",exp:" + exp + ",rules:" + rules.toString() + "]";
	}

}
